<template>
  <div class="width-style guide">
    <el-row :gutter="20">
      <el-col :span="9">
        <div class="grid-content">
          <ModuleTitle moduleName="医学前沿" innerModuleName="基因疗法" introduce="我是简介"/>
        </div>
        <!-- <div class="grid-content">
          <div class="guide-name">
            <span class="iconfont icon-guide">&#xe69e;</span>
            <span>医学前沿-基因疗法</span>
          </div>
          <div class="guide-introduce">我是简介我是简介</div>
        </div> -->
      </el-col>
      <el-col :span="9">
        <div class="grid-content guide-img-box">
          <img src="@/assets/images/medicalleadinggene.jpg" class="guide-img" />
        </div>
      </el-col>
      <el-col :span="6">
        <div class="grid-content">
          <Download />
        </div>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="18">
        <div class="grid-content">
          <div class="acticle-show-box">
            <span class="article-show">文章展示</span>
          </div>
          <ArticleShow
            :articleList="articleList"
            :total="total"
            catalogue="52"
            isChild="true"
          />
        </div>
      </el-col>
      <el-col :span="6">
        <div class="grid-content">
          <ModuleAdviser :doctorList="doctorList" />
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Download from "@/components/download.vue";
import ModuleAdviser from "@/components/moduleAdviser.vue";
import ArticleShow from "@/components/articleShow.vue";
import ModuleTitle from "@/components/moduleTitle.vue";
import { renderTime } from "@/utils/tools.js";
export default {
  layout: "homeLayout",
  components: { Download, ModuleAdviser, ArticleShow },
  async asyncData({ app }) {
    let res = await app.api.reqCoreGeneralByPage(52,1,5);
    if (res.code === 200) {
      for (let item of res.rows) {
        item.publishTime = renderTime(item.publishTime);
      }
    }
    //获取医生等列表
    let doctorRes = await app.api.reqAllDoctor();
    if (doctorRes.code === 200) {
      for (let doctor of doctorRes.rows) {
        doctor.doctorAvatar = app.api.BASEURL + doctor.doctorAvatar;
      }
    }
    return {
      articleList: res.rows,
      total: res.total,
      doctorList: doctorRes.rows,
    };
  },
};
</script>

<style scoped lang="less">
.el-row {
  margin-bottom: 20px;
  &:last-child {
    margin-bottom: 0;
  }
}
.grid-content {
  min-height: 36px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
.guide {
  .guide-img-box {
    height: 260px;
    .guide-img {
      width: 100%;
      height: 100%;
    }
  }
  .guide-name {
    margin-top: 10px;
    font-size: 22px;
    .icon-guide {
      font-size: 26px;
      color: @themeColor;
      vertical-align: bottom;
    }
  }
  .guide-introduce {
    margin: auto;
    margin-top: 50px;
    width: 70%;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
  }
  .acticle-show-box {
    text-align: left;
    .article-show {
      font-size: 20px;
      border-left: 3px solid @themeColor;
      padding-left: 5px;
    }
  }
}
</style>